<?php

namespace IMT\EventBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;


class RemoveController extends Controller
{
 	public function RemoveEventAction($id)
    {
    	if(!empty($id)){
    		$em = $this->getDoctrine()->getEntityManager();
    		$eventObject = $em->getRepository('IMTEventBundle:Event')->find($id);
    		$em->remove($eventObject);
    		$em->flush();
    	}else{
    		//TODO
    	}
    	
        return $this->redirect($this->generateUrl('accueil_planning'));
    }
}


